# -*- coding:utf-8 -*-
"""
@Time: 2022/1/6
@Description:
"""
from sqlalchemy import Column, Integer, Text, Float, String,JSON

from vo.table_model import BaseTable


class BookVo(BaseTable):
    # answer = [
    #     {'weight': 0.1, 'tag': '标签', 'demo': '案例', 'db': '基础数据', 'prove': '验证过程', 'ask': '为什么'}
    # ]
    __tablename__ = 'tree_book_vo'
    userId = Column(Integer, index=True, comment='用户id')
    parent_id = Column(Integer, default=0, comment='父级id')

    ask = Column(Text, default='', comment='问题')
    value = Column(Text, default='', comment='问题')

    weight = Column(Float(precision='10,2', decimal_return_scale=12), default=0, comment='权重')
    tag = Column(Text, default=0, comment='标签')
    demo = Column(Text, default=0, comment='案例')
    db = Column(JSON, default='[]', comment='基础数据')
    prove = Column(JSON, default='[]', comment='验证过程')

class YmlVo(BaseTable):
    __tablename__ = 'tree_yml_vo'
    value = Column(Text, default='', comment='问题')

class ProveVO(BaseTable):
    __tablename__ = 'prove_vo'
    userId = Column(Integer, index=True, comment='用户id')
    parent_id = Column(Integer, default=0, comment='父级id')
    value = Column(Text, default='', comment='内容')
    sort = Column(Integer, comment='排序顺序')
    wight = Column(Integer, default=1, comment='权重')


class StoryVO(BaseTable):
    __tablename__ = 'story_vo'
    userId = Column(Integer, index=True, comment='用户id')
    parent_id = Column(Integer, comment='父级id')
    value = Column(Text, default='', comment='内容')
    sort = Column(Integer, comment='排序顺序')
    wight = Column(Integer, default=1, comment='权重')
